function obj = GET_WorkingPoint(obj,varargin)
    p=inputParser;

    levelCheck = @(x) x > 0.0 && x < 10.0;
    biasRangeCheck = @(x) x > 0.0 && x < 1.0;
    phaseRangeCheck = @(x) x > 1 && x <= 180;
    freqCheck = @(x) x > 0 && x <= 1e7;

    p.addParameter('biasX', 1.0, levelCheck);
    p.addParameter('biasY', 2.0, levelCheck);
    p.addParameter('biasRawRange', 0.5, biasRangeCheck);
    p.addParameter('biasFineRange', 0.2, biasRangeCheck);
    p.addParameter('phaseFineRange', 10, phaseRangeCheck);
    p.addParameter('FreqRb85',1.01e5, freqCheck);
    p.parse(varargin{:});


    obj.ziMaster.loadSettings('D:\Code\Automeasurement\ziSettings\wp_bw3543.xml');
    obj.ziSlave.loadSettings('D:\Code\Automeasurement\ziSettings\wp_bw3560.xml');
    setMainField(obj,obj.parameter.volt_main);
    obj.ziMaster.setOscFreq(obj.working_point.channelDrv,obj.parameter.freq_main);
    obj.ziMaster.setSigOutAmplitude(obj.working_point.channelDrv, obj.parameter.volt_drv);
    obj.ziMaster.enableOutAmplitude(obj.working_point.channelDrv);

    obj.ziMaster.fireSigOut();
    obj.ziSlave.fireSigOut();
    obj.ziSlave.enableSigOutAdd();

    [phaseX0, phaseY0, biasX0, biasY0] = scanPhaseBias(obj,'biasX', p.Results.biasX, ...
                                                           'biasY', p.Results.biasY, ...
                                                           'biasRange', p.Results.biasRawRange, ...
                                                           'phaseXRange', [0.0, 180.0], ...
                                                           'phaseYRange', [0.0, 180.0], ...
                                                           'name', 'RawScan' );

    phaseRange = p.Results.phaseFineRange;
    [phaseX, phaseY, biasX, biasY, stdX, stdY, sseX, sseY, slopeX, slopeY] = scanPhaseBias(obj,'biasX', biasX0, ...
                                                       'biasY', biasY0, ...
                                                       'biasRange', p.Results.biasFineRange, ...
                                                       'phaseXRange', phaseX0 + [-phaseRange, phaseRange], ...
                                                       'phaseYRange', phaseY0 + [-phaseRange, phaseRange], ...
                                                       'name', 'FineScan','phasePoint',200 );
    if stdX > 0.001 || stdY > 0.001
        warning('Too large std error during phase sweeping.');
    end
    if sseX > 0.001 || sseY > 0.001
        warning('Bad fitting during bias sweeping.');
    end

    obj.working_point.result.phaseX = phaseX; obj.working_point.result.phaseY = phaseY;
    obj.working_point.result.biasX = biasX; obj.working_point.result.biasY = biasY;
    obj.working_point.result.stdX = stdX; obj.working_point.result.stdY = stdY;
    obj.working_point.result.sseX = sseX; obj.working_point.result.sseY = sseY;
    obj.working_point.result.coeffX = obj.parameter.Bx4DC_coeff*1e3 / slopeX; % nT/V
    obj.working_point.result.coeffY = obj.parameter.By1DC_coeff*1e3 / slopeY; % nT/V
end